/*
 *  cmd_macro.h
 *  edrift
 *
 *  Created by Yudi Rosandi on 3/22/12.
 *  Copyright 2012 TU-Kaiserslautern. All rights reserved.
 *
 */


void cmd_macro(istringstream& ss) {
  char lcmd[4096];
  int im;
  
  string mname;
  ss>>mname;
  
  if(me==0) im=search_macro(mname);
  
  MPI_Bcast(&im,1,MPI_INT,0,MPI_COMM_WORLD);
  if(im<0) throw (string("macro not found: ")+mname).c_str();
  
  if(me==0) {
    memset(lcmd,0,4096);
    macstring[im].copy((char*)lcmd,4096);
  }
  
  MPI_Bcast(lcmd,4096,MPI_CHAR,0,MPI_COMM_WORLD);
  
  parse(lcmd);
  
}
